﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="FProduct.aspx.cs" Inherits="FProduct" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
        <a href="Insert Product.aspx" style="color: #FF0000">Add Product</a>
        <asp:GridView ID="GridView1" runat="server" DataKeyNames="ProID" AutoGenerateEditButton ="true" AutoGenerateColumns ="false"
     OnRowEditing ="EditRecord" OnRowCancelingEdit="CancelRecord" OnRowDeleting="DeleteRecord" OnRowUpdating="UpdateRecord">
            <HeaderStyle BackColor ="LightBlue" ForeColor="White" />
            <EditRowStyle BackColor ="Aqua" />
            <SelectedRowStyle BackColor="Cyan" />
            <Columns>
                <asp:TemplateField HeaderText="ProductID">
                    <ItemTemplate>
                        <%# Eval("ProID")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtProductID" runat="server" Text='<%# Eval("ProID")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Product Name">
                    <ItemTemplate>
                        <%# Eval("ProductName")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtProductName" runat="server" Text='<%# Eval("ProductName")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category">
                    <ItemTemplate>
                        <%# Eval("Category")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtCategory" runat="server" Text='<%# Eval("Category")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="UnitPrice">
                    <ItemTemplate>
                        <%# Eval("UnitPrice")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtUnitPrice" runat="server" Text='<%# Eval("UnitPrice")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Quantity In Stock">
                    <ItemTemplate>
                        <%# Eval("QuantityInStock")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtQuantityInStock" runat="server" Text='<%# Eval("QuantityInStock")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Image">
                    <ItemTemplate>
                        <%# Eval("images")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtimages" runat="server" Text='<%# Eval("images")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <span onclick='return confirm("Do you want to delete record?")'>
                        <asp:LinkButton ID="linkDelete" runat ="server" CommandName="Delete" Text="Delete"></asp:LinkButton>
                        </span>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:Label ID="LResult" runat="server"></asp:Label>
    </div>
</asp:Content>

